﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Xunit;
using Moq;

namespace MvcWiki.Test.Repository.UnitOfWork
{
    public class SelectedFacts
    {
        [Fact]
        public void Can_Call()
        {
            var unitOfWorkPersistence = new Mock<MvcWiki.Repository.IUnitOfWorkPersistence>();

            var unitOfWork = new MvcWiki.Repository.UnitOfWork();

            var entity = new MvcWiki.Model.WikiPage();

            unitOfWork.Selected(entity, unitOfWorkPersistence.Object);
        }

        [Fact]
        public void Can_Select_The_Same_Entity_More_Than_Once()
        {
            var unitOfWorkPersistence = new Mock<MvcWiki.Repository.IUnitOfWorkPersistence>();

            var unitOfWork = new MvcWiki.Repository.UnitOfWork();

            var entity = new MvcWiki.Model.WikiPage();

            unitOfWork.Selected(entity, unitOfWorkPersistence.Object);
            unitOfWork.Selected(entity, unitOfWorkPersistence.Object);
        }
    }
}
